package com.lehecai.core.lottery.fetcher.lotterydraw.impl;

import com.lehecai.core.lottery.LotteryType;
import com.lehecai.core.lottery.fetcher.FetcherType;
import com.lehecai.core.lottery.fetcher.lotterydraw.LotteryDraw;
import com.lehecai.core.lottery.fetcher.lotterydraw.impl.worker.AbstractLotteryDrawFetchWorker;
import com.lehecai.core.lottery.fetcher.lotterydraw.impl.worker.LotteryDrawFetch23WorkerQihoo;
import com.lehecai.core.lottery.fetcher.lotterydraw.impl.worker.LotteryDrawFetchWorkerAiCaiPiao;
import com.lehecai.core.util.CoreFetcherUtils;

/**
 * 广东11选5开奖结果抓取
 * @author He Wang
 *
 */
public class LotteryDrawFetcher23 extends BaseLotteryDrawFetcher{
	
	private static final LotteryType lotteryType = LotteryType.GD11X5;
	
	protected LotteryDraw fetchQihoo(String phase) {
		AbstractLotteryDrawFetchWorker fetchWorker = new LotteryDrawFetch23WorkerQihoo(lotteryType);
		LotteryDraw resultListObj = fetchWorker.fetchResult(phase);
		LotteryDraw resultDetailObj = fetchWorker.fetchResultDetail(phase);
		LotteryDraw returnObj = CoreFetcherUtils.getComparedResult(resultListObj, resultDetailObj);
		return returnObj;
	}
	
	protected LotteryDraw fetchAiCaiPiao(String phase) {
		AbstractLotteryDrawFetchWorker fetchWorker = new LotteryDrawFetchWorkerAiCaiPiao(lotteryType);
		LotteryDraw resultListObj = fetchWorker.fetchResult(phase);
		LotteryDraw resultDetailObj = fetchWorker.fetchResultDetail(phase);
		LotteryDraw returnObj = CoreFetcherUtils.getComparedResult(resultListObj, resultDetailObj);
		return returnObj;
	}
	
	@Override
	protected FetcherType getDefaultFetcherType() {
		return FetcherType.T_QIHOO;
	}
}
